package com.learn.kotlinlearndemolist

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter

class ViewPagerAdapter(
    fragment: Fragment,
    var fragmentList: MutableList<Fragment>
) : FragmentStateAdapter(fragment) {

    override fun getItemCount(): Int =
        fragmentList.size


    override fun createFragment(position: Int): Fragment = fragmentList[position]

    override fun getItemId(position: Int): Long {
        return position.toLong()
    }
}